/**
 * Created by Cheney on 2017/7/14.
 */
function ParamUtil() {
    this.data = []
}
module.exports = ParamUtil
var proto = ParamUtil.prototype;

proto.push = function (elem) {
    this.data.push(elem)
    return this;
}


proto.pushArgs = function (args) {
    var array = Array.prototype.slice.apply(args)
    this.pushArray(array);
    return this;
}

proto.pushArray = function (array) {
    var self = this;
    array.forEach(function(v){
        self.data.push(v)
    })
    return this;
}

proto.pop = function () {
    return this.data.pop()
}

proto.unshift = function (elem) {
    this.data.unshift(elem)
    return this;
}

proto.unshiftArray = function (array) {
    this.data.unshift.apply(this , array)
    return this;
}

proto.shift = function () {
    return this.data.shift()
}

proto.call = function (func, that) {
    if( !that ){
      that = this;
    }
    return func && func.apply(that, this.data)
}

proto.get = function () {
    return this.data;
}


